#ifndef INPUTMGR_H_
#define INPUTMGR_H_

#include <list>
#include "listeners/KeyListener.h"
#include "listeners/MouseListener.h"

class InputMgr {
private:
	static InputMgr* instance;

	static std::list<KeyListener*> keyListeners;
	static std::list<MouseListener*> mouseListeners;

	InputMgr();

	// glut
	static bool _bLMouseDown;
	static void sMouse(int button, int updown, int x, int y);
	static void sMouseWheel(int wheel_number, int direction, int x, int y);
	static void sMotion(int x, int y);
	static void sJoystick( unsigned int buttonMask, int x, int y, int z); // GLUT_JOYSTICK_BUTTON_A
	static void sSpecialUp(int key, int x, int y);
	static void sKeyUp(unsigned char key, int x, int y);
	static void sSpecialDown(int key, int x, int y);
	static void sKeyDown(unsigned char key, int x, int y);

public:
	static InputMgr* getInstance();
	void registerListener(KeyListener* listener);
	void registerListener(MouseListener* listener);

	void deleteListener(KeyListener* listener);
	void deleteListener(MouseListener* listener);

};


#endif /* INPUTMGR_H_ */
